
import request from '@/utils/request'
import qs from 'qs'
// import store from '@/store';

interface User {
  phone: string;
  password: string;
}

export const login = (data: User) => {
  return request({
    method: 'post',
    url: '/front/user/login',
    data: qs.stringify(data),
    headers: {
      'content-type': 'application/x-www-form-urlencoded'
    }
  })
}

export const getUserInfo = () => {
  return request({
    method: 'get',
    url: '/front/user/getInfo'
    // headers: {
    //   'content-type': 'application/x-www-form-urlencoded'
    //   // authorization: store.state.user.access_token
    // }
  })
}

export const getUserPages = (data: any) => {
  return request({
    method: 'post',
    url: '/boss/user/getUerPages',
    data
  })
}

export const forbidUser = (userId: any) => {
  return request({
    method: 'post',
    url: '/boss/user/getUerPages',
    params: {
      userId
    }
  })
}
